package com.gzsxy.esjy.request.impl;

import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpVersion;

import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

/**
 * 文件请求类
 * @author zhangxiaolong
 * @date 2022/7/6 9:36
 */
public class FileHttpServletRequest {
	
	private final String uri ;
	
	private final HttpVersion protocolVersion ;
	
	private final HttpHeaders headers ;
	
	private final Charset charset ;
	
	private final boolean isKeepAlive ;
	
	private final Map<String,Object> map ;
	
	private String remoteUser ;
	
	private String remoteAddress ;
	
	private final boolean delete ;
	
	public boolean isKeepAlive() {
		return isKeepAlive;
	}
	
	public FileHttpServletRequest(HttpVersion protocolVersion, String uri, HttpHeaders headers, Charset charset, boolean isKeepAlive, boolean delete) {
		this.uri = uri ;
		this.protocolVersion = protocolVersion ;
		this.headers = headers ;
		this.charset = charset ;
		this.isKeepAlive = isKeepAlive ;
		this.map = new HashMap<String, Object>(2) ;
		this.delete = delete ;
	}
	public String getUri() {
		return uri;
	}

	
	public HttpVersion getProtocolVersion() {
		return protocolVersion;
	}

	public HttpHeaders getHeaders() {
		return headers;
	}


	
	public String getHeader(String name) {
		return headers.get(name);
	}

	public Charset getCharset() {
		return charset;
	}
	
	public Map<String, Object> getParams() {
		return map;
	}

	public String getRemoteUser() {
		return remoteUser;
	}

	public FileHttpServletRequest setRemoteUser(String remoteUser) {
		this.remoteUser = remoteUser;
		return this ;
	}

	public String getRemoteAddress() {
		return remoteAddress;
	}

	public FileHttpServletRequest setRemoteAddress(String remoteAddress) {
		this.remoteAddress = remoteAddress;
		return this ;
	}

	public boolean isDelete() {
		return delete;
	}

}
